function daleiBtnClick(){
  wx.getBluetoothAdapterState({
    success: function (res) {
      if (wx.getStorageSync("deviceId")) {
        if (wx.getStorageSync("boxStatus") == "打擂中") {
          wx.redirectTo({
            url: '/pages/contesting/contesting'
          });
        }
        else if (wx.getStorageSync("boxStatus") == "查看成绩") {
          wx.redirectTo({
            url: '/pages/contesting/contesting'
          });
        }
        else {
          wx.redirectTo({
            url: '/pages/contest/contest?deviceId=' + wx.getStorageSync("deviceId") +
            '&deviceName' + wx.getStorageSync("deviceName")
          });
        }
      }
      else{
        wx.redirectTo({
          url: '/pages/startBluetooth/startBlue'
        });
      }
    }, fail: function (res) {
      wx.redirectTo({
        url: '/pages/startBluetooth/startBlue'
      });
      wx.removeStorageSync("deviceId");
      wx.removeStorageSync("deviceName");
      wx.removeStorageSync("boxStatus");
    }
  }); 
}
function toastShow(){
  let that=this;
  let instance = true;
  setTimeout(function () {
    instance = false;
  }, 3000);
}

module.exports = {
  daleiBtnClick: daleiBtnClick,
  toastShow:toastShow
}